package com.my.study.sync;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.Async;

import java.util.concurrent.TimeUnit;

/**
 * @author yidujun
 * @version 1.0.0
 * @date 2023/7/27 14:15
 */
public class SyncUtils {
    
    private static final Logger LOG = LoggerFactory.getLogger(SyncUtils.class);

    @Async(value = "commonPool")
    public void syncTest() {
        LOG.info("[syncTest] 开始...");
        try {
            TimeUnit.SECONDS.sleep(1);
            LOG.info("[syncTest]处理业务.....");
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        LOG.info("[syncTest] 结束...");
    }
}
